package com.etone.export.DB2DB.dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;


/**
 * @author ZhangWeixiong
 * @date 2011-11-18
 *
 */
public abstract class BaseDao {
	
	private Connection conn;
	
	public abstract Connection getConn();
	
	protected Connection initConn(String driver, String url, String user, String pwd) throws ClassNotFoundException, SQLException {
		
		Class.forName(driver);
		conn = DriverManager.getConnection(url, user, pwd); 
		
		return conn;
	}
	
	
	public ResultSet getResultSet(String sql) throws SQLException{
		
		ResultSet rs = null;
		
		Statement stmt = getConn().createStatement();
		rs = stmt.executeQuery(sql);
		
		return rs;
	}
	
	public void insertTable(String sql, Object...objects ){
		
	}
}
